<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>记录时间的痕迹</title>
  <link href="/public/css/main.css" rel="stylesheet" type="text/css">
  <link href="/public/fontAwesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  <script src="/public/js/jquery-1.12.4.min.js"></script>
</head>

<body>
  <!-- 头部 -->
  <div class="blog_header">
    <img src="/public/img/title_log.png" alt="" class="img_logo">
  </div>
  <!-- 内容 -->
  <div class="blog_container">
    <!-- 导航 -->
    <div class="container_nav">
      <ul>
        {%if category == ''%}
        <li class="nav_item_active">
          <a href="/">首页</a>
        </li>
        {%else%}
        <li>
          <a href="/">首页</a>
        </li>
        {%endif%}

        {% for item in categories %}

        {%if category == item.id%}
        <li class="nav_item_active">
          <a href="/?category={{item._id.toString()}}">{{item.name}}</a>
        </li>
        {%else%}
        <li>
          <a href="/?category={{item._id.toString()}}">{{item.name}}</a>
        </li>
        {%endif%}
        {% endfor %}
      </ul>
    </div>
    <div class="container_content">
      {%block content%}{%endblock%}
      <div class="user_model fr">
        {% if userInfo._id %}
        <!-- 用户信息 -->
        <div class="rightBox" id="userInfo">
          <div class="title">
            <span>用户信息</span>
          </div>
          <p>
            <span class="colDark">
              {{ userInfo.username }}
            </span>
          </p>
          <p>
            {% if userInfo.isAdmin %}
            <span class="colDanger">
              你好，管理员！
              <a href="/admin">进入管理</a>
            </span>
            {% else %}
            <span class="colDanger">
              你好，欢迎光临我的博客！
            </span>
            {% endif %}
          </p>
          <p>
            <span class="colDark">
              <a href="javascript:;" id="logout">退出</a>
            </span>
          </p>
        </div>
        {% else %}
        <!-- 登陆 -->
        <div class="rightBox" id="loginBox">
          <div class="title">
            <span>登录</span>
          </div>
          <div class="line">
            <span class="colDark">用户名：</span>
            <input name="username" type="text" />
            <em></em>
          </div>
          <div class="line">
            <span class="colDark">密码：</span>
            <input name="password" type="password" />
            <em></em>
          </div>
          <div class="line">
            <span class="colDark"></span>
            <button class="login">登 录</button>
          </div>
          <p class="textRight">
            还没注册？
            <a href="javascript:;" class="colMint">马上注册</a>　
          </p>
          <p class="colWarning textCenter"></p>
        </div>
        <!-- 注册 -->
        <div class="rightBox" id="registerBox" style="display: none;">
          <div class="title">
            <span>注册</span>
          </div>
          <div class="line">
            <span class="colDark">用户名：</span>
            <input name="username" type="text" />
          </div>
          <div class="line">
            <span class="colDark">密码：</span>
            <input name="password" type="password" />
          </div>
          <div class="line">
            <span class="colDark">确认：</span>
            <input name="repassword" type="password" />
          </div>
          <div class="line">
            <span class="colDark"></span>
            <button>注 册</button>
          </div>
          <p class="textRight">
            已有账号？
            <a href="javascript:;" class="colMint">马上登录</a>　
          </p>
          <p class="colWarning textCenter"></p>
        </div>
        {% endif %}
        <!-- 社区 -->
        <div class="rightBox">
          <div class="title"><span>社区</span></div>
          <p>
            <a href="http://nodejs.cn/" target="_blank" class="colDanger">Node感兴趣吗</a>
          </p>
          <p>
            <a href="https://www.npmjs.com" target="_blank" class="colDanger">NPM呢</a>
          </p>
        </div>
      </div>
    </div>
  </div>
  <!-- 底部 -->
  <div class="blog_footer">
    <!-- Copyright © xxxx.com 版权所有 | 京ICP备08102442号 -->
    Copyright 此内容并无任何版权 | 京ICP备号 也没有
  </div>
</body>

<script src="/public/js/index.js"></script>

</html>
